package com.qfedu.provider.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 作品日志
 * @TableName db_dynamic_log
 */
@TableName(value ="db_dynamic_log")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DbDynamicLog implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 发布人id
     */
    @TableField(value = "user_id")
    private String userId;

    /**
     * 作品类型
     */
    @TableField(value = "production_type")
    private String productionType;

    /**
     * 作品id
     */
    @TableField(value = "production_id")
    private String productionId;

    /**
     * 操作人ip
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * 操作
     */
    @TableField(value = "comment")
    private String comment;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    public DbDynamicLog(String userId, String productionType, String productionId, String ip, String comment){
        this.userId = userId;
        this.productionType = productionType;
        this.productionId = productionId;
        this.ip = ip;
        this.comment = comment;
        this.createTime = new Date();
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}